<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新闻</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
    <meta name="keywords" content="塑连网络科技,互联网公司，新媒体,公司成立于2019年，注册资本1000万元,互联网信息技术服务，微信小程序——全球挤出工程师认证系统">
    <meta name="Description" content="塑连网同时注重新媒体平台的发展，搭建了以服务号、公众号、抖音号为主体的新媒体传播矩阵。目前，塑连网的新媒体矩阵已经成型，并且形成了对行业热点反应迅速，宣传手段多样化，内容制作标准化，推广目标精准化的独特优势，在行业内积累了一定的影响力。">
    <link rel="shortcut icon" href="image/logo.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="css/animate.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="css/news.css">
    <style>
        /*.layui-box .layui-laypage a:hover {*/
            /*color: #F6523A !important;*/
        /*}*/
    </style>
</head>
<body>
<div class="toubuHead" id="toubuHead"></div>
<div class="content_body"  style="">
    <div class="content1">
        <ul class="listData"></ul>
        <p id="page" class="animated slideInRight "></p>
    </div>
</div>
<div class="foot wenzi_bottom" id="wenzi_bottom"></div>

<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="js/rem.js"></script>
<script src="layui/layui.js"></script>
<script src="js/loadHF.js"></script>
<script>
    let loadIndex;
    let size=8;
    let num=1;
    layui.use([ 'layer', 'jquery','laypage'], () => {
        let laypage=layui.laypage;
        let $=layui.jquery;
        let layer=layui.layer;
        layer.ready(function() {
            loadIndex = layer.load(1,{
                // time:2 * 1000,
                shade: [1,'#ddd']
            });
        });
        $(function () {
            $.ajax({
                type: "get",
                url: "https://www.polynk.cn/server/news/all",
                // data:{
                //     "num": 'currId',
                //     "size": 'limitId',
                // },
                dataType: 'json',
                success:(res)=> {
                    // console.log(res);
                    layer.close(loadIndex);
                    let dataLen=res.data;
                    // console.log(dataLen);
                    if(res.code===200){
                        laypage.render({
                            elem: 'page',
                            theme:"#F6523A",
                            count: dataLen.length, //数据总数，从服务端得到
                            limit: size,   //每页条数设置
                            layout: ['count', 'prev', 'page', 'next','skip'],
                            // curr:location.hash.replace('#!fenye=', ''),
                            // hash: 'fenye',
                            jump: function (obj) {
                                // console.log(obj.count);
                                size=obj.limit;  //得到每页显示的条数
                                num=obj.curr;//得到当前页，以便向服务端请求对应页的数据。
                                document.querySelector('.listData').innerHTML= function (){
                                    let arr = [];
                                    let thisData = dataLen.concat().splice(obj.curr * obj.limit - obj.limit, obj.limit);
                                    layui.each(thisData, function (index,item) {
                                        let text =`
                                               <li class="box wave animated slideInLeft" data-id="${item.id}" title="${item.title}">

                                                   <div class="titlename slh">${item.title}</div>
                                                   <p class="time">${item.createTime}</p>
                                               </li>
                                               `;
                                        arr.push(text);
                                    });
                                    return arr.join('');
                                }();
                            }
                        });
                    }

                }
            });

            /**点击说说跳转详情页面**/
            $(".content1").on("click", ".listData .box", function (e) {
                console.log(e)
                window.location.href = 'newsDetails.html?id=' + $(e.currentTarget).attr('data-id');
            });
        })

    })
</script>
</body>
</html>